package me.militch.quickcore.execute;

import java.util.List;

import io.reactivex.Flowable;
import me.militch.quickcore.mvp.view.AbsListView;
import me.militch.quickcore.util.ApiException;
import me.militch.quickcore.util.EventCall;
import me.militch.quickcore.event.ListViewEvent;
import me.militch.quickcore.mvp.model.ModelHelper;
import me.militch.quickcore.util.RespBase;
import me.militch.quickcore.event.ViewEvent;

public class ListViewExecute<T> extends ViewExecute<AbsListView<T>> {
    protected ListViewExecute(AbsListView<T> view) {
        super(view);
    }
//    protected ListViewExecute(AbsListView<T> view) {
//        super(view);
//    }
//    public static <T> ListViewExecute<T> bind(AbsListView<T> view){
//        return new ListViewExecute<T>(view);
//    }
//    public ListViewExecute<T> setModelHelper(ModelHelper modelHelper){
//       super.setModelHelper(modelHelper);
//        return this;
//    }
//
//    public ListViewExecute<T> toDoList(Flowable<RespBase<List<T>>> respResult, final ListViewEvent<T> okVt, final ViewEvent<AbsListView<T>,ApiException> eVt){
//        if(getModelHelper() == null||getView() == null){
//            return null;
//        }
//        getModelHelper().request(respResult, new EventCall<List<T>>() {
//            @Override
//            public void call(List<T> ds) {
//                if (okVt !=null)
//                    okVt.call(getView(),ds);
//            }
//        }, new EventCall<ApiException>() {
//            @Override
//            public void call(ApiException e) {
//                if (eVt != null)
//                    eVt.call(getView(), e);
//            }
//        });
//        return this;
//    }
}
